package com.woniuxy.mapper;

import com.woniuxy.entity.Food;
import com.woniuxy.entity.FoodExample;

import java.util.List;
import java.util.Map;

import com.woniuxy.vo.FoodCommentlVO;
import com.woniuxy.vo.FoodVO;
import org.apache.ibatis.annotations.Param;

public interface FoodMapper {
    long countByExample(FoodExample example);

    int deleteByExample(FoodExample example);

    int deleteByPrimaryKey(Integer foodId);

    int insert(Food record);

    int insertSelective(Food record);

    List<Food> selectByExample(FoodExample example);

    Food selectByPrimaryKey(Integer foodId);

    int updateByExampleSelective(@Param("record") Food record, @Param("example") FoodExample example);

    int updateByExample(@Param("record") Food record, @Param("example") FoodExample example);

    int updateByPrimaryKeySelective(Food record);

    int updateByPrimaryKey(Food record);

    /**
     * 条件分页查询
     *
     * @param map
     * @return
     */
    List<FoodVO> pageSelectFoodByExample(Map<String, Object> map);

    /**
     * 统计总条数
     *
     * @param map
     * @return
     */
    int countFoodByExample(Map<String, Object> map);

    /**
     * 添加美食返回主键
     * @param food
     * @return
     */
    int insertFoodReturnFoodId(Food food);

    /**
     * ele
     * 查询所有美食的评论
     * @return
     */
    List<FoodCommentlVO> selectAllFoodCommentlVO();
}